<template>
  <div>
<Grandson></Grandson>
<button @click="put">修改provide值</button>
  </div>
</template>

<script setup>
import { provide, ref } from 'vue';
import Grandson from './components/Grandson.vue';

let str='letter from app.vue'
let str2=ref('letter from app.vue 响应式')
const put=()=>{
  //响应式数据赋值必须加上.value,不然就会是重新赋值,不是响应式的
  // str2='letter from app.vue 2'
  // console.log(str2);
  str2.value='letter from app.vue 2'
  
}

provide('key',str2)

</script>

<style lang="scss" scoped>

</style>